Repository navigation
[Nexthop][fboss2-dev] Warn instead of rejecting a profile the transceiver does not support - #1982
Open
hillol-nexthop wants to merge 1 commit into
Open
hillol-nexthop wants to merge 1 commit into
hillol-nexthop wants to merge 1 commit into
Conversation
hillol-nexthop
force-pushed
the
profile-qsfp-warning
branch
from
November 16, 2026 08:50
00d2e3a to
4214870
Compare
… not support `fboss2-dev config interface <port> profile <p>` rejected any profile missing from qsfp_service's transceiver-filtered list for the port. The agent has no such check: it applies whatever platform-supported profile its config carries. A port could therefore be running a profile that the CLI refused to set, including re-applying the one it already runs. One case is a passive copper cable on a port configured with an OPTICAL profile: the link is up, but once the port is moved to a COPPER profile the CLI cannot move it back. Make the transceiver list advisory in the command layer. The platform mapping still decides what is accepted; a profile missing from a port's non-empty transceiver list is applied and reported as a warning after the success line. When qsfp_service cannot be reached the command says the profile was not checked. utility::applyPortProfileChanges keeps its behaviour; the CLI no longer passes it the transceiver list.
hillol-nexthop
force-pushed
the
profile-qsfp-warning
branch
from
November 16, 2026 08:54
4214870 to
3187ef7
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-submission checklist
Summary
fboss2-dev config interface <port> profile <p>rejects any profile that is not in qsfp_service's transceiver-filtered list for the port (getAllPortSupportedProfiles(checkOptics=true)). The agent has no such check: it applies whatever platform-supported profile its config carries. A port can therefore be running a profile that the CLI refuses to set, including re-applying the one it already runs.A concrete case: a passive copper cable on a port whose config profile is OPTICAL. The link is up, but since passive copper stopped reporting OPTICAL profiles as supported, the CLI rejects that profile.
ConfigInterfaceProfileTest.ChangeProfileWithoutSubsumingSucceedsandDeleteInterfaceTest.DeleteWholePortRemovesCreatedSubportfail on such a device: they move the port to another profile and then cannot restore the original one.This change makes the CLI follow the same rule as the agent: the platform mapping decides what is accepted, and the transceiver list is advisory.
CmdConfigInterface.cpp:applyProfileImplno longer passes the transceiver list toutility::applyPortProfileChanges, so validation is platform-only. After a successful apply it compares each requested port against its non-empty transceiver list and collects a warning for a mismatch.queryClientprints the warnings on their own lines after the success line.utility::applyPortProfileChangeskeeps its behaviour and tests. Its optional transceiver constraint now has no caller in the CLI; I left it in place since it is part of the shared API and noted in its doc comment that fboss2-dev does not pass it, but can remove it here if you prefer.show interface capabilitiesand qsfp_service are unchanged.Behaviour change to be aware of: a profile an optical module cannot run is now also accepted with a warning instead of rejected, the same as it would be if it came from the agent config. If you would rather keep the rejection for that case and relax only re-applying the running profile, I am happy to rework it that way.
Known limit, unchanged from before: qsfp_service returns no entry for a port when the transceiver matches none of its profiles or the cage is empty, so there is nothing to warn against in that case.
Tests:
rejectsProfileUnsupportedByQsfpbecomeswarnsOnlyForPortsUnsupportedByQsfp(two ports in one command, one warns); addedwarnsOnExistingPortUnsupportedByQsfp,noWarningWhenQsfpSupportsOrDoesNotReportPort,queryClientPrintsQsfpWarningAfterSuccessandqueryClientReportsUnreachableQsfpService.ConfigInterfaceProfileTest.ProfileUnsupportedByOpticsWarns. It commits a platform-supported profile the port's transceiver does not support (one other than the running profile that subsumes nothing when available, otherwise the running profile), checks the warning, waits for the agent to report the profile, and restores the original.Test Plan
Unit tests (this branch, OSS cmake build):
Integration tests on an NH-4010-F whose ports
eth1/1/1,eth1/2/1andeth1/4/1hold passive copper cables, are configured withPROFILE_800G_8_PAM4_RS544X2N_OPTICAL, and are link Up at 800G.Before:
After:
On the device the new test committed a real change and put it back:
With qsfp_service stopped:
A platform-unsupported profile is still rejected:
The device run used binaries built from our internal tree, where the integration test reads the transceiver list through a shared fixture helper that is not upstream yet; in this PR the test queries qsfp_service directly. That variant was compiled and linked by the OSS cmake build but not run on a device. Not run: a device with optical modules, where the committed profile is one the optic rejects.
Review Findings
Pre-publication review found no correctness or build issues. Two low-severity notes remain; findings acknowledged, pushed at author's discretion.
fboss/lib/config/agent/PortConfigUtils.cppapplyPortProfileChangesis no longer passed by the CLI, so its reject branch is reachable only from the library's own tests. Left in place as part of the shared API.fboss/cli/fboss2/commands/config/interface/CmdConfigInterface.cpp